package com.bawei.hgshop.entity;

import java.io.Serializable;
import java.math.BigDecimal;

/**
 * 订单的明细
 * @时间  2021-1-12  9:31:24
 *
 */
public class OrderDetail implements Serializable  {

	/**
	 * 
	 */
	private static final long serialVersionUID = -1543562092435983693L;
	
	private int id;    // 主键id
	private Sku sku;  // 对应的sku
	private BigDecimal total;//总价格
	private int oid;//订单的id
	private int pnum;//购买数量
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public Sku getSku() {
		return sku;
	}
	public void setSku(Sku sku) {
		this.sku = sku;
	}
	public BigDecimal getTotal() {
		return total;
	}
	public void setTotal(BigDecimal total) {
		this.total = total;
	}
	public int getOid() {
		return oid;
	}
	public void setOid(int oid) {
		this.oid = oid;
	}
	public int getPnum() {
		return pnum;
	}
	public void setPnum(int pnum) {
		this.pnum = pnum;
	}
	public static long getSerialversionuid() {
		return serialVersionUID;
	}
	@Override
	public String toString() {
		return "OrderDetail [id=" + id + ", sku=" + sku + ", total=" + total + ", oid=" + oid + ", pnum=" + pnum + "]";
	}
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + id;
		result = prime * result + oid;
		result = prime * result + pnum;
		result = prime * result + ((sku == null) ? 0 : sku.hashCode());
		result = prime * result + ((total == null) ? 0 : total.hashCode());
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		OrderDetail other = (OrderDetail) obj;
		if (id != other.id)
			return false;
		if (oid != other.oid)
			return false;
		if (pnum != other.pnum)
			return false;
		if (sku == null) {
			if (other.sku != null)
				return false;
		} else if (!sku.equals(other.sku))
			return false;
		if (total == null) {
			if (other.total != null)
				return false;
		} else if (!total.equals(other.total))
			return false;
		return true;
	}
	
	


}
